Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6344601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:40:23+00:00 2026-05-24T20:40:23+00:00

As per another question I had asked earlier I think I may have found

  • 0

As per another question I had asked earlier I think I may have found my problem but I need an experts eye.

I found the file /net/ipv4/tcp_zero_copy.c which was causing a compile failure of my kernel.

I no very little about C or C++, when I look at the file in my C/C++ editor it looks like the same code is repeating over over over (I think 4 times).

My question is simple;

Would that be enough to cause a problem with the compiler? If the same code showed up over and over in the same file?

Here is the source code of the file (from end to end 148 lines in total);

/*
 *  Support routines for TCP zero copy transmit
 *
 *  Created by Vladislav Bolkhovitin
 *
 *  This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License
 *      version 2 as published by the Free Software Foundation.
 */

#include <linux/skbuff.h>

net_get_page_callback_t net_get_page_callback __read_mostly;
EXPORT_SYMBOL(net_get_page_callback);

net_put_page_callback_t net_put_page_callback __read_mostly;
EXPORT_SYMBOL(net_put_page_callback);

/*
 * Caller of this function must ensure that at the moment when it's called
 * there are no pages in the system with net_priv field set to non-zero
 * value. Hence, this function, as well as net_get_page() and net_put_page(),
 * don't need any protection.
 */
int net_set_get_put_page_callbacks(
    net_get_page_callback_t get_callback,
    net_put_page_callback_t put_callback)
{
    int res = 0;

    if ((net_get_page_callback != NULL) && (get_callback != NULL) &&
        (net_get_page_callback != get_callback)) {
        res = -EBUSY;
        goto out;
    }

    if ((net_put_page_callback != NULL) && (put_callback != NULL) &&
        (net_put_page_callback != put_callback)) {
        res = -EBUSY;
        goto out;
    }

    net_get_page_callback = get_callback;
    net_put_page_callback = put_callback;

out:
    return res;
}
EXPORT_SYMBOL(net_set_get_put_page_callbacks);
/*
 *  Support routines for TCP zero copy transmit
 *
 *  Created by Vladislav Bolkhovitin
 *
 *  This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License
 *      version 2 as published by the Free Software Foundation.
 */

#include <linux/skbuff.h>

net_get_page_callback_t net_get_page_callback __read_mostly;
EXPORT_SYMBOL(net_get_page_callback);

net_put_page_callback_t net_put_page_callback __read_mostly;
EXPORT_SYMBOL(net_put_page_callback);

/*
 * Caller of this function must ensure that at the moment when it's called
 * there are no pages in the system with net_priv field set to non-zero
 * value. Hence, this function, as well as net_get_page() and net_put_page(),
 * don't need any protection.
 */
int net_set_get_put_page_callbacks(
    net_get_page_callback_t get_callback,
    net_put_page_callback_t put_callback)
{
    int res = 0;

    if ((net_get_page_callback != NULL) && (get_callback != NULL) &&
        (net_get_page_callback != get_callback)) {
        res = -EBUSY;
        goto out;
    }

    if ((net_put_page_callback != NULL) && (put_callback != NULL) &&
        (net_put_page_callback != put_callback)) {
        res = -EBUSY;
        goto out;
    }

    net_get_page_callback = get_callback;
    net_put_page_callback = put_callback;

out:
    return res;
}
EXPORT_SYMBOL(net_set_get_put_page_callbacks);
/*
 *  Support routines for TCP zero copy transmit
 *
 *  Created by Vladislav Bolkhovitin
 *
 *  This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License
 *      version 2 as published by the Free Software Foundation.
 */

#include <linux/skbuff.h>

net_get_page_callback_t net_get_page_callback __read_mostly;
EXPORT_SYMBOL(net_get_page_callback);

net_put_page_callback_t net_put_page_callback __read_mostly;
EXPORT_SYMBOL(net_put_page_callback);

/*
 * Caller of this function must ensure that at the moment when it's called
 * there are no pages in the system with net_priv field set to non-zero
 * value. Hence, this function, as well as net_get_page() and net_put_page(),
 * don't need any protection.
 */
int net_set_get_put_page_callbacks(
    net_get_page_callback_t get_callback,
    net_put_page_callback_t put_callback)
{
    int res = 0;

    if ((net_get_page_callback != NULL) && (get_callback != NULL) &&
        (net_get_page_callback != get_callback)) {
        res = -EBUSY;
        goto out;
    }

    if ((net_put_page_callback != NULL) && (put_callback != NULL) &&
        (net_put_page_callback != put_callback)) {
        res = -EBUSY;
        goto out;
    }

    net_get_page_callback = get_callback;
    net_put_page_callback = put_callback;

out:
    return res;
}
EXPORT_SYMBOL(net_set_get_put_page_callbacks);

** EDIT **

Also I just used Notepad++ to compare the individual blocks of code where it looked like they ended. According to the compare tool all 3 block match each other.

Here is the compiler output from the place it died to the command prompt it returned to me.

  CC      net/ipv4/tcp_zero_copy.o
net/ipv4/tcp_zero_copy.c:63:1: error: redefinition of â__kcrctab_net_get_page_callbackâ
net/ipv4/tcp_zero_copy.c:14:1: note: previous definition of â__kcrctab_net_get_page_callbackâ was here
net/ipv4/tcp_zero_copy.c:63:1: error: redefinition of â__kstrtab_net_get_page_callbackâ
net/ipv4/tcp_zero_copy.c:14:1: note: previous definition of â__kstrtab_net_get_page_callbackâ was here
net/ipv4/tcp_zero_copy.c:63:1: error: redefinition of â__ksymtab_net_get_page_callbackâ
net/ipv4/tcp_zero_copy.c:14:1: note: previous definition of â__ksymtab_net_get_page_callbackâ was here
net/ipv4/tcp_zero_copy.c:66:1: error: redefinition of â__kcrctab_net_put_page_callbackâ
net/ipv4/tcp_zero_copy.c:17:1: note: previous definition of â__kcrctab_net_put_page_callbackâ was here
net/ipv4/tcp_zero_copy.c:66:1: error: redefinition of â__kstrtab_net_put_page_callbackâ
net/ipv4/tcp_zero_copy.c:17:1: note: previous definition of â__kstrtab_net_put_page_callbackâ was here
net/ipv4/tcp_zero_copy.c:66:1: error: redefinition of â__ksymtab_net_put_page_callbackâ
net/ipv4/tcp_zero_copy.c:17:1: note: previous definition of â__ksymtab_net_put_page_callbackâ was here
net/ipv4/tcp_zero_copy.c:74:5: error: redefinition of ânet_set_get_put_page_callbacksâ
net/ipv4/tcp_zero_copy.c:25:5: note: previous definition of ânet_set_get_put_page_callbacksâ was here
net/ipv4/tcp_zero_copy.c:98:1: error: redefinition of â__kcrctab_net_set_get_put_page_callbacksâ
net/ipv4/tcp_zero_copy.c:49:1: note: previous definition of â__kcrctab_net_set_get_put_page_callbacksâ was here
net/ipv4/tcp_zero_copy.c:98:1: error: redefinition of â__kstrtab_net_set_get_put_page_callbacksâ
net/ipv4/tcp_zero_copy.c:49:1: note: previous definition of â__kstrtab_net_set_get_put_page_callbacksâ was here
net/ipv4/tcp_zero_copy.c:98:1: error: redefinition of â__ksymtab_net_set_get_put_page_callbacksâ
net/ipv4/tcp_zero_copy.c:49:1: note: previous definition of â__ksymtab_net_set_get_put_page_callbacksâ was here
make[2]: *** [net/ipv4/tcp_zero_copy.o] Error 1
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2
root@dev01:/usr/src/linux# ls
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:40:24+00:00Added an answer on May 24, 2026 at 8:40 pm

    It depends on what is being repeated,

    A function declaration repeated won’t give any errors.
    A function definition repeated would give errors.
    A variable being created\defined with same name would give errors.

    #2 & #3 give errors as they break the ODR(One Definition Rule).

    void doSomething(); //no error
    void doSomething();
    void doSomething();
    
    void doSomething()
    {
    
    }
    
    int main()
    {
        int i; //error
        int i;
        doSomething();
        return 1;
    }
    

    In this code:

    net_get_page_callback_t net_get_page_callback __read_mostly;
    

    defines an variable and doing so repeatedly, leads to multiple definition of same named variable and hence the redefinition error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Per a great answer from another question I have begun mounting global resources (css/js/images)
I recently asked a question (and had it answered) here: jQuery Load JSON I
This is a followup/post question to another question; as I have discovered a solution
I have a project that I have recently started working on seriously but had
Relating to another question I asked yesterday with regards to logging I was introduced
As per Shanes excellent solution of another question, I now realise that I do
Sorry for yet another question about EF4 context lifespan, but I've been wondering about
This is a clarification of an earlier question I asked. It is sufficiently different
i have already asked this question on asp.net forum, could not find any satisfactory
I know the question has been asked many times but I'd like an answer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.