| 745 | } |
| 746 | |
| 747 | static int |
| 748 | pfsync_in_clr(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) |
| 749 | { |
| 750 | struct pfsync_clr *clr; |
| 751 | struct mbuf *mp; |
| 752 | int len = sizeof(*clr) * count; |
| 753 | int i, offp; |
| 754 | u_int32_t creatorid; |
| 755 | |
| 756 | mp = m_pulldown(m, offset, len, &offp); |
| 757 | if (mp == NULL) { |
| 758 | V_pfsyncstats.pfsyncs_badlen++; |
| 759 | return (-1); |
| 760 | } |
| 761 | clr = (struct pfsync_clr *)(mp->m_data + offp); |
| 762 | |
| 763 | for (i = 0; i < count; i++) { |
| 764 | creatorid = clr[i].creatorid; |
| 765 | |
| 766 | if (clr[i].ifname[0] != '\0' && |
| 767 | pfi_kkif_find(clr[i].ifname) == NULL) |
| 768 | continue; |
| 769 | |
| 770 | for (int i = 0; i <= pf_hashmask; i++) { |
| 771 | struct pf_idhash *ih = &V_pf_idhash[i]; |
| 772 | struct pf_state *s; |
| 773 | relock: |
| 774 | PF_HASHROW_LOCK(ih); |
| 775 | LIST_FOREACH(s, &ih->states, entry) { |
| 776 | if (s->creatorid == creatorid) { |
| 777 | s->state_flags |= PFSTATE_NOSYNC; |
| 778 | pf_unlink_state(s, PF_ENTER_LOCKED); |
| 779 | goto relock; |
| 780 | } |
| 781 | } |
| 782 | PF_HASHROW_UNLOCK(ih); |
| 783 | } |
| 784 | } |
| 785 | |
| 786 | return (len); |
| 787 | } |
| 788 | |
| 789 | static int |
| 790 | pfsync_in_ins(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) |
nothing calls this directly
no test coverage detected