Hello Matthieu,

</snip>

On Tue, Feb 28, 2023 at 02:05:50PM +0100, Matthieu Herrb wrote:
> > --- a/sys/net/pf.c
> > +++ b/sys/net/pf.c
> > @@ -6846,8 +6846,12 @@ pf_walk_header(struct pf_pdesc *pd, struct ip *h, 
> > u_short *reason)
> >     pd->proto = h->ip_p;
> >     /* IGMP packets have router alert options, allow them */
> >     if (pd->proto == IPPROTO_IGMP) {
> > -           /* According to RFC 1112 ttl must be set to 1. */
> > -           if ((h->ip_ttl != 1) || !IN_MULTICAST(h->ip_dst.s_addr)) {
> > +           /*
> > +            * According to RFC 1112 ttl must be set to 1 in all IGMP
> > +            * packets sent do 224.0.0.1
> > +            */
> > +           if ((h->ip_ttl != 1) &&
> > +               (h->ip_dst.s_addr == INADDR_ALLHOSTS_GROUP)) {
> >                     DPFPRINTF(LOG_NOTICE, "Invalid IGMP");
> >                     REASON_SET(reason, PFRES_IPOPTIONS);
> >                     return (PF_DROP);
> > 
> 
> 
> Hi,
> 
> The expression look wrong to me again.
> I read in RFC1112 that correct packets should have:
> 
>   (h->ip_ttl == 1 && h->ip.ip_dst.s_addr == INADDR_ALLHOST_GROUP)

    the expression above is true for for Query/Report messages
    which are a sub-set of IGMP protocol. See Luca's emails with
    references to RFCs which further extend IGMP protocol.

    here in this particular place (pf_walk_header()) I think we really
    want to simply discard all IGMP datagrams sent to 224.0.0.1 with TTL
    different to 1.  anything else should be passed further up and let pf(4)
    rules to make a decision on those cases.

thanks and
regards
sashan

Reply via email to