| 825 | } |
| 826 | |
| 827 | static int |
| 828 | pfsync_in_iack(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) |
| 829 | { |
| 830 | struct pfsync_ins_ack *ia, *iaa; |
| 831 | struct pf_state *st; |
| 832 | |
| 833 | struct mbuf *mp; |
| 834 | int len = count * sizeof(*ia); |
| 835 | int offp, i; |
| 836 | |
| 837 | mp = m_pulldown(m, offset, len, &offp); |
| 838 | if (mp == NULL) { |
| 839 | V_pfsyncstats.pfsyncs_badlen++; |
| 840 | return (-1); |
| 841 | } |
| 842 | iaa = (struct pfsync_ins_ack *)(mp->m_data + offp); |
| 843 | |
| 844 | for (i = 0; i < count; i++) { |
| 845 | ia = &iaa[i]; |
| 846 | |
| 847 | st = pf_find_state_byid(ia->id, ia->creatorid); |
| 848 | if (st == NULL) |
| 849 | continue; |
| 850 | |
| 851 | if (st->state_flags & PFSTATE_ACK) { |
| 852 | pfsync_undefer_state(st, 0); |
| 853 | } |
| 854 | PF_STATE_UNLOCK(st); |
| 855 | } |
| 856 | /* |
| 857 | * XXX this is not yet implemented, but we know the size of the |
| 858 | * message so we can skip it. |
| 859 | */ |
| 860 | |
| 861 | return (count * sizeof(struct pfsync_ins_ack)); |
| 862 | } |
| 863 | |
| 864 | static int |
| 865 | pfsync_upd_tcp(struct pf_state *st, struct pfsync_state_peer *src, |
nothing calls this directly
no test coverage detected