My bitch very recently had a very bad case of mastitis, it greatly depends on the severity of it, mild mastitis the pups can feed and you will need to massage and hot towel the infected teat, more severe will need antibiotics, and the pups can still be fed, very, very bad cases the vet will ask you not to feed and allow the bitches milk to dry up and then you will have to hand rear the pups.
Keep an eye on things, unfortunately when my vet told me to dry up my bitches milk as she had a very severe case, I thought him mad! Ingnored him and my bitch had to have an emergency operation and I ended up hand rearing all 9 pups from 2 weeks old.
That was a very unusual case so do not worry, but go by your vets advice.