From: Ben Pfaff Date: Tue, 11 Nov 2008 21:01:12 +0000 (-0800) Subject: Make snat_skb() skb argument const. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=490098aa4df889b5140b7a350835561717eacd61;p=openvswitch Make snat_skb() skb argument const. After all, it doesn't modify it. --- diff --git a/datapath/nx_act_snat.c b/datapath/nx_act_snat.c index 819299e6..5ff8feda 100644 --- a/datapath/nx_act_snat.c +++ b/datapath/nx_act_snat.c @@ -346,12 +346,12 @@ snat_skb_finish(struct sk_buff *skb) /* Update the MAC->IP mappings for the private side of the SNAT'd * interface. */ static void -update_mapping(struct net_bridge_port *p, struct sk_buff *skb) +update_mapping(struct net_bridge_port *p, const struct sk_buff *skb) { unsigned long flags; struct snat_conf *sc; - struct iphdr *iph = ip_hdr(skb); - struct ethhdr *eh = eth_hdr(skb); + const struct iphdr *iph = ip_hdr(skb); + const struct ethhdr *eh = eth_hdr(skb); struct snat_mapping *m; spin_lock_irqsave(&p->lock, flags); @@ -387,7 +387,7 @@ done: * unmodified. 'skb' is not consumed, so caller will need to free it. */ void -snat_skb(struct datapath *dp, struct sk_buff *skb, int out_port) +snat_skb(struct datapath *dp, const struct sk_buff *skb, int out_port) { struct net_bridge_port *p = dp->ports[out_port]; struct sk_buff *nskb; diff --git a/datapath/nx_act_snat.h b/datapath/nx_act_snat.h index 76797d45..7d5f37dd 100644 --- a/datapath/nx_act_snat.h +++ b/datapath/nx_act_snat.h @@ -30,7 +30,7 @@ struct snat_conf { void snat_local_in(struct sk_buff *skb); int snat_pre_route(struct sk_buff *skb); -void snat_skb(struct datapath *dp, struct sk_buff *skb, int out_port); +void snat_skb(struct datapath *dp, const struct sk_buff *skb, int out_port); void snat_maint(struct net_bridge_port *p); int snat_mod_config(struct datapath *, const struct nx_act_config *); int snat_free_conf(struct net_bridge_port *p);