If an invalid port index was used in dp_set_origin, the value of skb->dev
was left unchanged. This change causes skb->dev to be set to NULL in those
circumstances. This makes Packet Out and Add Flow messages that use a
buffer id behave like Packet Out without a buffer id.
/* Marks 'skb' as having originated from 'in_port' in 'dp'.
FIXME: how are devices reference counted? */
-int dp_set_origin(struct datapath *dp, uint16_t in_port,
+void dp_set_origin(struct datapath *dp, uint16_t in_port,
struct sk_buff *skb)
{
struct net_bridge_port *p = (in_port < OFPP_MAX ? dp->ports[in_port]
: in_port == OFPP_LOCAL ? dp->local_port
: NULL);
- if (p) {
+ if (p)
skb->dev = p->dev;
- return 0;
- }
- return -ENOENT;
+ else
+ skb->dev = NULL;
}
static int xmit_skb(struct sk_buff *skb)
int ignore_no_fwd);
int dp_output_control(struct datapath *, struct sk_buff *, uint32_t,
size_t, int);
-int dp_set_origin(struct datapath *, uint16_t, struct sk_buff *);
+void dp_set_origin(struct datapath *, uint16_t, struct sk_buff *);
int dp_send_features_reply(struct datapath *, const struct sender *);
int dp_send_config_reply(struct datapath *, const struct sender *);
int dp_send_port_status(struct net_bridge_port *p, uint8_t status);