From 490098aa4df889b5140b7a350835561717eacd61 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 11 Nov 2008 13:01:12 -0800 Subject: [PATCH] Make snat_skb() skb argument const. After all, it doesn't modify it. --- datapath/nx_act_snat.c | 8 ++++---- datapath/nx_act_snat.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/datapath/nx_act_snat.c b/datapath/nx_act_snat.c index 819299e64..5ff8feda7 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 76797d45c..7d5f37dd6 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); -- 2.43.0