summaryrefslogtreecommitdiffstats
path: root/usr.sbin/switchd/packet.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2016-07-20 20:07:02 +0000
committerreyk <reyk@openbsd.org>2016-07-20 20:07:02 +0000
commitc7486977e7641790f03139d0eb5c0ef25b437c75 (patch)
treef7832d721921acf575eb20c42565924b243c3c20 /usr.sbin/switchd/packet.c
parentParse and print OpenFlow 1.3 PACKET_IN and OXM (Openflow eXtended Match) - (diff)
downloadwireguard-openbsd-c7486977e7641790f03139d0eb5c0ef25b437c75.tar.xz
wireguard-openbsd-c7486977e7641790f03139d0eb5c0ef25b437c75.zip
Handle ports as uint32_t instead of in_port_t: OpenFlow 1.0 used 16bit
ports, but later versions switched to 32bit ports (for the case that a virtual switch has more than 65535 switch ports, of course).
Diffstat (limited to 'usr.sbin/switchd/packet.c')
-rw-r--r--usr.sbin/switchd/packet.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/switchd/packet.c b/usr.sbin/switchd/packet.c
index 39df7a9af2b..089c06b2821 100644
--- a/usr.sbin/switchd/packet.c
+++ b/usr.sbin/switchd/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.1 2016/07/19 16:54:26 reyk Exp $ */
+/* $OpenBSD: packet.c,v 1.2 2016/07/20 20:07:02 reyk Exp $ */
/*
* Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
@@ -50,8 +50,8 @@ packet_ether_unicast(uint8_t *ea)
return (0);
}
-long
-packet_input(struct switchd *sc, struct switch_control *sw, long port,
+uint32_t
+packet_input(struct switchd *sc, struct switch_control *sw, uint32_t port,
struct ibuf *ibuf, size_t len, struct packet *pkt)
{
struct ether_header *eh;
@@ -78,11 +78,11 @@ packet_input(struct switchd *sc, struct switch_control *sw, long port,
else
dst = switch_cached(sw, eh->ether_dhost);
- log_debug("%s: %s -> %s, port %ld -> %ld", __func__,
+ log_debug("%s: %s -> %s, port %u -> %u", __func__,
print_ether(eh->ether_shost),
print_ether(eh->ether_dhost),
src->mac_port,
- dst == NULL ? -1 : dst->mac_port);
+ dst == NULL ? OFP_PORT_ANY : dst->mac_port);
- return (dst == NULL ? -1 : dst->mac_port);
+ return (dst == NULL ? OFP_PORT_ANY : dst->mac_port);
}