incoming broadcast IP packets filtration

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown incoming broadcast IP packets filtration

by Александр Усов :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello.

Sorry for my bad English. If I understood rfc919 right, there are two types
of broadcasts: "local" which is 255.255.255.255 and "remote" which is, for
example, 192.168.1.255 when 192.168.1.0 is subnet address. But NutIpInput()
function sets up "bcast" flag even if the destination broadcast IP address
is from another subnet.

Maybe, checking like this:
   dst == ( nif->if_local_ip | ~nif->if_mask )
is more correct than
   ( dst | nif->if_mask ) == INADDR_BROADCAST
?

Thanks for your attention.
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: incoming broadcast IP packets filtration

by Ethernut :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Александр Усов wrote:

> Sorry for my bad English. If I understood rfc919 right, there are two types
> of broadcasts: "local" which is 255.255.255.255 and "remote" which is, for
> example, 192.168.1.255 when 192.168.1.0 is subnet address. But NutIpInput()

Both are handled in NutIpInput().


> function sets up "bcast" flag even if the destination broadcast IP address
> is from another subnet.

You are right. This may provide problems when setting up subnets.


> Maybe, checking like this:
>    dst == ( nif->if_local_ip | ~nif->if_mask )
> is more correct than
>    ( dst | nif->if_mask ) == INADDR_BROADCAST
> ?

I agree, this would solve it and discard broadcasts to other subnets.

Thanks,

Harald

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion