Deleted Added
full compact
25c25
< * $FreeBSD: head/sys/netinet/ip_fw2.c 135168 2004-09-13 19:27:23Z andre $
---
> * $FreeBSD: head/sys/netinet/ip_fw2.c 135920 2004-09-29 04:54:33Z mlaier $
1534a1535,1550
> static void
> fill_ugid_cache(struct inpcb *inp, struct ip_fw_ugid *ugp)
> {
> struct ucred *cr;
>
> if (inp->inp_socket != NULL) {
> cr = inp->inp_socket->so_cred;
> ugp->fw_prid = jailed(cr) ?
> cr->cr_prison->pr_id : -1;
> ugp->fw_uid = cr->cr_uid;
> ugp->fw_ngroups = cr->cr_ngroups;
> bcopy(cr->cr_groups, ugp->fw_groups,
> sizeof(ugp->fw_groups));
> }
> }
>
1540c1556
< struct ip_fw_ugid *ugp, int *lookup)
---
> struct ip_fw_ugid *ugp, int *lookup, struct inpcb *inp)
1546d1561
< struct ucred *cr;
1549a1565,1576
> * Check to see if the UDP or TCP stack supplied us with
> * the PCB. If so, rather then holding a lock and looking
> * up the PCB, we can use the one that was supplied.
> */
> if (inp && *lookup == 0) {
> INP_LOCK_ASSERT(inp);
> if (inp->inp_socket != NULL) {
> fill_ugid_cache(inp, ugp);
> *lookup = 1;
> }
> }
> /*
1566c1593
< INP_INFO_RLOCK(pi); /* XXX LOR with IPFW */
---
> INP_INFO_RLOCK(pi);
1579,1585c1606
< cr = pcb->inp_socket->so_cred;
< ugp->fw_prid = jailed(cr) ?
< cr->cr_prison->pr_id : -1;
< ugp->fw_uid = cr->cr_uid;
< ugp->fw_ngroups = cr->cr_ngroups;
< bcopy(cr->cr_groups, ugp->fw_groups,
< sizeof(ugp->fw_groups));
---
> fill_ugid_cache(pcb, ugp);
1941c1962
< &ugid_lookup);
---
> &ugid_lookup, args->inp);