}
h=(struct icmphdr *)buf->start;
- if ((ntohs(h->iph.frag)&(IPHDR_FRAG_OFF|IPHDR_FRAG_MORE))!=0) {
- Message(M_WARNING,"%s: fragmented packet addressed to secnet; "
- "ignoring it\n",st->name);
+ unsigned fraginfo = ntohs(h->iph.frag);
+ if ((fraginfo&(IPHDR_FRAG_OFF|IPHDR_FRAG_MORE))!=0) {
+ if (!(fraginfo & IPHDR_FRAG_OFF))
+ /* report only for first fragment */
+ Message(M_WARNING,"%s: fragmented packet addressed to secnet; "
+ "ignoring it\n",st->name);
BUF_FREE(buf);
return;
}
BUF_FREE(buf);
return;
}
- assert(buf->size >= (int)sizeof(struct icmphdr));
+ assert(buf->size >= (int)sizeof(struct iphdr));
iph=(struct iphdr *)buf->start;
source=ntohl(iph->saddr);
}
static void netlink_inst_reg(void *sst, netlink_deliver_fn *deliver,
- void *dst)
+ void *dst, uint32_t *localmtu_r)
{
struct netlink_client *c=sst;
+ struct netlink *st=c->nst;
c->deliver=deliver;
c->dst=dst;
+
+ if (localmtu_r)
+ *localmtu_r=st->mtu;
}
static struct flagstr netlink_option_table[]={