summaryrefslogtreecommitdiffstats
path: root/src/extra/ipv4.c
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-04-10 12:58:04 -0700
committerPablo Neira Ayuso <pablo@netfilter.org>2017-04-14 01:38:48 +0200
commit58cb0668dc15c78cd3af9eeaedf29386e86ecac1 (patch)
tree46d7352ebbbdf7c41a019248bfc94c788849fc95 /src/extra/ipv4.c
parentb39cac7afe54e08bb5d8af6e082de9b4f3a273ec (diff)
src: Declare the define visibility attribute together
clang ignores the visibility attribute if its not defined before the definition. As a result these symbols become hidden and consumers of this library fail to link due to these missing symbols. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/extra/ipv4.c')
-rw-r--r--src/extra/ipv4.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/extra/ipv4.c b/src/extra/ipv4.c
index a93d113..56d5dc7 100644
--- a/src/extra/ipv4.c
+++ b/src/extra/ipv4.c
@@ -32,7 +32,7 @@
* This funcion returns NULL if the IPv4 is malformed or the protocol version
* is not 4. On success, it returns a valid pointer to the IPv4 header.
*/
-struct iphdr *nfq_ip_get_hdr(struct pkt_buff *pktb)
+struct iphdr __EXPORTED *nfq_ip_get_hdr(struct pkt_buff *pktb)
{
struct iphdr *iph;
unsigned int pktlen = pktb->tail - pktb->network_header;
@@ -53,14 +53,13 @@ struct iphdr *nfq_ip_get_hdr(struct pkt_buff *pktb)
return iph;
}
-EXPORT_SYMBOL(nfq_ip_get_hdr);
/**
* nfq_ip_set_transport_header - set transport header
* \param pktb: pointer to network packet buffer
* \param iph: pointer to the IPv4 header
*/
-int nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
+int __EXPORTED nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
{
int doff = iph->ihl * 4;
@@ -71,7 +70,6 @@ int nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
pktb->transport_header = pktb->network_header + doff;
return 0;
}
-EXPORT_SYMBOL(nfq_ip_set_transport_header);
/**
* nfq_ip_set_checksum - set IPv4 checksum
@@ -80,14 +78,13 @@ EXPORT_SYMBOL(nfq_ip_set_transport_header);
* \note Call to this function if you modified the IPv4 header to update the
* checksum.
*/
-void nfq_ip_set_checksum(struct iphdr *iph)
+void __EXPORTED nfq_ip_set_checksum(struct iphdr *iph)
{
uint32_t iph_len = iph->ihl * 4;
iph->check = 0;
iph->check = nfq_checksum(0, (uint16_t *)iph, iph_len);
}
-EXPORT_SYMBOL(nfq_ip_set_checksum);
/**
* nfq_ip_mangle - mangle IPv4 packet buffer
@@ -100,7 +97,7 @@ EXPORT_SYMBOL(nfq_ip_set_checksum);
*
* \note This function recalculates the IPv4 checksum (if needed).
*/
-int nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
+int __EXPORTED nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
unsigned int match_offset, unsigned int match_len,
const char *rep_buffer, unsigned int rep_len)
{
@@ -116,7 +113,6 @@ int nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
return 1;
}
-EXPORT_SYMBOL(nfq_ip_mangle);
/**
* nfq_pkt_snprintf_ip - print IPv4 header into buffer in iptables LOG format
@@ -128,7 +124,7 @@ EXPORT_SYMBOL(nfq_ip_mangle);
* case that there is enough room in the buffer. Read snprintf manpage for more
* information to know more about this strange behaviour.
*/
-int nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
+int __EXPORTED nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
{
int ret;
struct in_addr src = { iph->saddr };
@@ -147,7 +143,6 @@ int nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
return ret;
}
-EXPORT_SYMBOL(nfq_ip_snprintf);
/**
* @}