looks good

On Thu, Sep 8, 2011 at 11:40, Ben Pfaff <[email protected]> wrote:
> Seems like a very small cleanup.
> ---
>  ofproto/ofproto.c |    3 +--
>  ofproto/pktbuf.c  |   10 ++++++++--
>  2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 849a376..090d4d3 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -1581,7 +1581,6 @@ handle_packet_out(struct ofconn *ofconn, const struct 
> ofp_header *oh)
>     struct ofpbuf request;
>     struct flow flow;
>     size_t n_ofp_actions;
> -    uint16_t in_port;
>     int error;
>
>     COVERAGE_INC(ofproto_packet_out);
> @@ -1605,7 +1604,7 @@ handle_packet_out(struct ofconn *ofconn, const struct 
> ofp_header *oh)
>     /* Get payload. */
>     if (opo->buffer_id != htonl(UINT32_MAX)) {
>         error = ofconn_pktbuf_retrieve(ofconn, ntohl(opo->buffer_id),
> -                                       &buffer, &in_port);
> +                                       &buffer, NULL);
>         if (error || !buffer) {
>             return error;
>         }
> diff --git a/ofproto/pktbuf.c b/ofproto/pktbuf.c
> index 02c590c..fc4c66c 100644
> --- a/ofproto/pktbuf.c
> +++ b/ofproto/pktbuf.c
> @@ -161,6 +161,8 @@ pktbuf_get_null(void)
>  * identifies a "null" packet buffer (created with pktbuf_get_null()), stores
>  * NULL in '*bufferp' and UINT16_max in '*in_port'.
>  *
> + * 'in_port' may be NULL if the input port is not of interest.
> + *
>  * A returned packet will have at least sizeof(struct ofp_packet_in) bytes of
>  * headroom.
>  *
> @@ -189,7 +191,9 @@ pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct 
> ofpbuf **bufferp,
>         struct ofpbuf *buffer = p->buffer;
>         if (buffer) {
>             *bufferp = buffer;
> -            *in_port = p->in_port;
> +            if (in_port) {
> +                *in_port = p->in_port;
> +            }
>             p->buffer = NULL;
>             COVERAGE_INC(pktbuf_retrieved);
>             return 0;
> @@ -211,7 +215,9 @@ pktbuf_retrieve(struct pktbuf *pb, uint32_t id, struct 
> ofpbuf **bufferp,
>     }
>  error:
>     *bufferp = NULL;
> -    *in_port = UINT16_MAX;
> +    if (in_port) {
> +        *in_port = UINT16_MAX;
> +    }
>     return error;
>  }
>
> --
> 1.7.4.4
>
> _______________________________________________
> dev mailing list
> [email protected]
> http://openvswitch.org/mailman/listinfo/dev
>
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to