[Q.] Would you mind telling me how to insert new header into...

From: Blusjune Jung (blusjune@yahoo.com)
Date: Fri Jun 16 2000 - 08:06:18 EST


How can I insert new header between network protocol stack?

IPsec AH implementation is what I've got interest in thesedays.
This format of IP datagram is what I want.
+-----------+----+------------------------+------+
| IP header | AH | Transport layer header | Data |
+-----------+----+------------------------+------+

To insert new header (such like 'AH' in IPsec) like above, I've tried to that work by inserting new structure into 'struct sk_buff' as the following.

        /* in struct sk_buff, */
        struct sk_buff {
                ...
                /* Union for transport layer header */
                ...

                union { /* Here! IPsec union I've inserted */
                        struct ipsec_ah *ah;
                        struct ipsec_esp *esph;
                } ipsec_h;
                ...
                /* Union for IP layer header */
                ...
        };

And in source file 'ip_output.c', I modified the function 'ip_queue_xmit(...)' to insert the IPsec AH processing module.
Just for reference, I did use the function related to sk_buff called 'skb_push()' to allocate the space for IPsec AH header.
(But..., indeed, I did never use any other functions related to sk_buff. -_-;;; This may be the cause of kernel panic.)

After finishing this work, I did compile and link the linux kernel without any warning and error, and I rebooted my linux box.

But... during the booting sequence, I can't help watching the following message from kernel.

        <7>eth0: Transmit error, Tx status register 90.
        Kernel panic: skput:over: c8028ab0:0 put:114 dev:eth0
        In swapper task - not syncing

Several rebooting have only brought me the same result. -_-;;;

I think, the message "skput:over: c8028..." means that 'head' and 'data' is not located properly. (i.e., skb->data < skb->head )

The core reason of the kernel panic maybe due to the lack of proper 'sk_buff' handling. That is, skb_reserve(), skb_cow(), etc. ...

At this time, I really wonder what is necessary to insert new header between IP header and the Trasnport layer header.
Is the method I've tried to so far correct?
That is, (1) insertion of new union for IPsec header into 'sk_buff', and (2) using of sk_buff handling function, such that 'skb_push()', 'skb_reserve()'.
What functions are needed for these job?

Thank you very much for your concern...

-- 

| blusjune@nirva | ^_^ | stoneroses | Blusjune Jung Email: blusjune@yahoo.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:31 EST