From: Ian Jackson Date: Sun, 13 Apr 2014 14:43:15 +0000 (+0100) Subject: netlink: Only complain about initial frags for us X-Git-Tag: debian/0.3.1_beta1~5 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=commitdiff_plain;h=6e3fd952d7052293905334a3bb3911c775222ea6 netlink: Only complain about initial frags for us secnet has no reassembly code and logs whenever it receives fragments. Change this to only log when receiving initial fragments; this reduces noise in the log. Signed-off-by: Ian Jackson --- diff --git a/netlink.c b/netlink.c index 55eef5c..2c3d12d 100644 --- a/netlink.c +++ b/netlink.c @@ -775,9 +775,12 @@ static void netlink_packet_local(struct netlink *st, } 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; }