Annotation of elwix/patches/freebsd.pf.inline.anchor.PR196314.patch, revision 1.1.2.1
1.1.2.1 ! misho 1: diff --git sbin/pfctl/pfctl.c sbin/pfctl/pfctl.c
! 2: index 64b4a05..8a7fc0b 100644
! 3: --- sbin/pfctl/pfctl.c
! 4: +++ sbin/pfctl/pfctl.c
! 5: @@ -102,7 +102,7 @@ int pfctl_show_anchors(int, int, char *);
! 6: int pfctl_ruleset_trans(struct pfctl *, char *, struct pf_anchor *);
! 7: int pfctl_load_ruleset(struct pfctl *, char *,
! 8: struct pf_ruleset *, int, int);
! 9: -int pfctl_load_rule(struct pfctl *, char *, struct pf_rule *, int);
! 10: +int pfctl_load_rule(struct pfctl *, const char *, struct pf_rule *, int);
! 11: const char *pfctl_lookup_option(char *, const char **);
! 12:
! 13: struct pf_anchor_global pf_anchors;
! 14: @@ -1322,12 +1322,11 @@ pfctl_load_ruleset(struct pfctl *pf, char *path, struct pf_ruleset *rs,
! 15: }
! 16:
! 17: int
! 18: -pfctl_load_rule(struct pfctl *pf, char *path, struct pf_rule *r, int depth)
! 19: +pfctl_load_rule(struct pfctl *pf, const char *path, struct pf_rule *r, int depth)
! 20: {
! 21: u_int8_t rs_num = pf_get_ruleset_number(r->action);
! 22: char *name;
! 23: struct pfioc_rule pr;
! 24: - int len = strlen(path);
! 25:
! 26: bzero(&pr, sizeof(pr));
! 27: /* set up anchor before adding to path for anchor_call */
! 28: @@ -1337,15 +1336,9 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pf_rule *r, int depth)
! 29: errx(1, "pfctl_load_rule: strlcpy");
! 30:
! 31: if (r->anchor) {
! 32: - if (r->anchor->match) {
! 33: - if (path[0])
! 34: - snprintf(&path[len], MAXPATHLEN - len,
! 35: - "/%s", r->anchor->name);
! 36: - else
! 37: - snprintf(&path[len], MAXPATHLEN - len,
! 38: - "%s", r->anchor->name);
! 39: - name = path;
! 40: - } else
! 41: + if (r->anchor->match)
! 42: + name = r->anchor->name;
! 43: + else
! 44: name = r->anchor->path;
! 45: } else
! 46: name = "";
! 47: @@ -1368,7 +1361,6 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pf_rule *r, int depth)
! 48: pf->opts & PF_OPT_VERBOSE2,
! 49: pf->opts & PF_OPT_NUMERIC);
! 50: }
! 51: - path[len] = '\0';
! 52: pfctl_clear_pool(&r->rpool);
! 53: return (0);
! 54: }
! 55: --
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>