Hello,

when we ran PF sources through coverity we got an error
as follows:

8310           if (ri->r->dst.addr.type == PF_ADDR_TABLE)
8311                       pfr_update_stats(ri->r->dst.addr.p.tbl,
8312                              &s->key[(s->direction == PF_IN)]->
8313                              addr[(s->direction == PF_IN)],

    
CID 38100 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)copy_paste_error: src
in ri->r->src.neg looks like a copy-paste error.
    
Should it say dst instead?
8314                            pd, ri->r->action, ri->r->src.neg);
8315                        }
8316                }

(note: line numbers won't match line numbers in OpenBSD).

It seems to me coveirty is right. Patch against CURRENT is attached.

kind regards
sasha


--------- cut here to get patch ----------
Warning: Permanently added 'anoncvs.ca.openbsd.org' (ECDSA) to the list of 
known hosts.
Index: pf.c
===================================================================
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.909
diff -u -r1.909 pf.c
--- pf.c        18 Mar 2015 12:23:15 -0000      1.909
+++ pf.c        5 Apr 2015 09:46:46 -0000
@@ -6277,7 +6277,7 @@
                                        pfr_update_stats(ri->r->dst.addr.p.tbl,
                                            &s->key[(s->direction == PF_IN)]->
                                                addr[(s->direction == PF_IN)],
-                                           pd, ri->r->action, ri->r->src.neg);
+                                           pd, ri->r->action, ri->r->dst.neg);
                        }
                }
                if (r->src.addr.type == PF_ADDR_TABLE)

Index: pf.c
===================================================================
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.909
diff -u -r1.909 pf.c
--- pf.c        18 Mar 2015 12:23:15 -0000      1.909
+++ pf.c        5 Apr 2015 09:47:18 -0000
@@ -6277,7 +6277,7 @@
                                        pfr_update_stats(ri->r->dst.addr.p.tbl,
                                            &s->key[(s->direction == PF_IN)]->
                                                addr[(s->direction == PF_IN)],
-                                           pd, ri->r->action, ri->r->src.neg);
+                                           pd, ri->r->action, ri->r->dst.neg);
                        }
                }
                if (r->src.addr.type == PF_ADDR_TABLE)

Reply via email to