diff options
author | Rafael Zalamena <rzalamena@cvs.openbsd.org> | 2016-11-07 13:18:19 +0000 |
---|---|---|
committer | Rafael Zalamena <rzalamena@cvs.openbsd.org> | 2016-11-07 13:18:19 +0000 |
commit | 6b954547fef4041cbc511cfb1dc3565e572b06d0 (patch) | |
tree | 81b5a25e2cacd983a10ddf698473319b7b1a01d5 | |
parent | 3ed33d2a10847a8e2cbf3bc7dafe1f9fd66e1edb (diff) |
Fix a small parsing error in packet-in: don't count ofp_match header bytes
when iterating over the OXMs. It only works because the last bytes are
either padding or something that looks like OXM.
ok reyk@
-rw-r--r-- | usr.sbin/switchd/ofp13.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/switchd/ofp13.c b/usr.sbin/switchd/ofp13.c index 662197d9ac6..b798f2c3ac8 100644 --- a/usr.sbin/switchd/ofp13.c +++ b/usr.sbin/switchd/ofp13.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofp13.c,v 1.23 2016/11/04 22:33:04 reyk Exp $ */ +/* $OpenBSD: ofp13.c,v 1.24 2016/11/07 13:18:18 rzalamena Exp $ */ /* * Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org> @@ -408,6 +408,7 @@ ofp13_validate_packet_in(struct switchd *sc, log_debug("\tmatch type %s length %zu (padded to %zu)", print_map(ntohs(om->om_type), ofp_match_map), mlen, OFP_ALIGN(mlen) + ETHER_ALIGN); + mlen -= sizeof(*om); /* current match offset, aligned offset after all matches */ moff = off + sizeof(*om); |